<span id="load" url="<?=image_url('load.gif');?>"></span>
<div class="panel">
	<div class="row">
		<div class="large-4 columns">
			<div class="btn-group">
				<a href="<?=site_url('teacher/my_classes');?>" class="confirm btn btn-success"title="are you sure you want to exit from grade creator?">Exit</a>
				<a href="<?=site_url('teacher/advisory_input_grades/'.$hash);?>" class="btn">Grades <i class="icon-g-table icon-g-black"></i></a>
				<a href="<?=site_url('teacher/advisory_input_attendance/'.$hash);?>" class="btn btn-primary">Attendance <i class="icon-g-calendar icon-g-white"></i></a>
				<a href="<?=site_url('teacher/advisory_input_remarks/'.$hash);?>" class="btn btn-primary">Remarks <i class="icon-comment icon-white"></i></a>
			</div>
		</div>
		<div class="large-4 columns">
		<?if(isset($section_desc)):?>
			<?if($section_desc):?>
				<?$sec = current($section_desc);?>
				<span style="font-weight:bold;font-size:16px;">Section Name:&nbsp;&nbsp;<?=$sec->section_name;?>,</span>
				<span style="font-weight:bold;font-size:16px;">Grade Level:&nbsp;&nbsp;<?=$sec->level_desc;?></span>
			<?endif;?>
		<?endif;?>
		</div>
		<div class="large-4 columns">
			<label>Go to Section</label>
			<?=form_dropdown('sections',$sections,set_value('sections',$hash),'style="width:200px;display:inline-block;" class="redirect-auto" url="'.$current_url.'"');?>
		</div>
	</div>
</div>
<div>
<div>
	<ul class="nav nav-tabs">
	  <li><a href="<?=site_url('teacher/advisory_input_grades/'.$hash);?>">Bulk Insert</a></li>
	  <li><a href="<?=site_url('teacher/advisory_progress_report/'.$hash);?>" class="current">Single Insert</a></li>
	</ul>
</div>
	<?=form_dropdown('student', $students,$eid_hash,'class="redirect-auto" style="padding:5px;font-weight:bold;font-size:15px;" url="'.$current_url.'/'.$hash.'"');?>
<?if($section_exists):?>
	<?if(isset($student_grades)):?>
		<table class="table">
			<tr class="info">
				<td colspan="2" style="font-weight:bold;">LEARNING AREAS</td>
					<?foreach($gp as $k=>$v):?>
						<td  style="font-weight:bold;"><?=strtoupper($v->gp_code);?></td>
					<?endforeach;?>
				<td style="font-weight:bold;">FINAL</td>
			</tr>
			<?foreach ($student_grades as $key => $value):?>
				<tr>
					<td colspan="2"><?=$value['name'];?></td>
					<?if($value['grades']):?>
						<?foreach($value['grades'] as $v):?>
							<td>
								<input style="width:50px;display:inline-block;margin:-1px;" type="text" value="<?=$v->value;?>" url="<?=site_url('output/set_student_grades/'.__link($v->id));?>" class="ajax-change" orgval="<?=$v->value;?>">
								<span class="loading" style="display:inline-block;"></span>
							</td>
						<?endforeach;?>
						<td></td>
					<?else:?>
					<?endif;?>
				</tr>
			<?endforeach;?>
		</table>
	<?else:?>
		<div class="alert-box success">
			Please Select A Student.
		</div>
	<?endif;?>
<?endif;?>
</div>
<script src="<?=script_url('custom/grades');?>" type="text/javascript"></script>